using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;


namespace Data.Models
{
    public class dbParafarmaciaContext : DbContext
    {
        static dbParafarmaciaContext()
        {
            Database.SetInitializer<dbParafarmaciaContext>(null);
        }

        public dbParafarmaciaContext()
            : base("Name=context")
        {
        }


        public DbSet<tblEmpresaInfo> tblEmpresaInfos { get; set; }
        public DbSet<tblCategoria> tblCategorias { get; set; }
        public DbSet<tblMarca> tblMarcas { get; set; }
        public DbSet<tblPedido> tblPedidos { get; set; }

        public DbSet<tblProducto> tblProductos { get; set; }
        public DbSet<tblProductoImagenes> tblProductosImagenes { get; set; }
        
        public DbSet<tblUsuario> tblUsuarios { get; set; }
        public DbSet<tblContenido> tblContenidos { get; set; }
        

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
            Database.SetInitializer(new CreateDatabaseIfNotExists<dbParafarmaciaContext>());
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<dbParafarmaciaContext>());

        }
    }
}
